package com.karl.springboot.service.impl;

import com.karl.springboot.entity.TPhonebook;
import com.karl.springboot.utils.PinYinUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.karl.springboot.service.TPhonebookService;

/**
 * 
 * @author karl
 *    TPhonebook业务层实现类
 * @date 2020-12-05 15:43:01
 */
@Service
@Transactional(readOnly = false)
public class TPhonebookServiceImpl extends BaseServiceImpl<TPhonebook> implements TPhonebookService {
    @Override
    public String save(TPhonebook tPhonebook) throws Exception {
        tPhonebook.setInitial(PinYinUtil.getFirstByName(tPhonebook.getName()));
        return super.save(tPhonebook);
    }
}
